const AlipaySdk = require("alipay-sdk");
const fs = require('fs')
const path = require('path')
// 实例化客户端
const alipaySdk = new AlipaySdk({
  // 设置应用 ID
  appId: '9021000133628166',
  // 设置应用私钥
  privateKey: fs.readFileSync(path.resolve(__dirname, 'private-key.pem'), 'ascii'),
  // 设置支付宝公钥
  alipayPublicKey: fs.readFileSync(path.resolve(__dirname, 'alipay-public-key.pem'), 'ascii'),

  gateway: 'https://openapi-sandbox.dl.alipaydev.com/gateway.do',
});

const config = {
  //启动端口
  port: 8002,
  //数据库配置
  database: {
    DATABASE: "nodesql",
    USERNAME: "root",
    PASSWORD: "123456",
    PORT: "3306",
    HOST: "localhost",
  },
  // 密钥
  secretKey: "weirhnwoqlejq123",
  // 阿里云
  alipaySdk: alipaySdk
};

module.exports = config;
